﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Globalization;
using System.Threading;

namespace Assignments_1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void showForm(object sender, EventArgs e)
        {
           Form2 frm = new Form2();
           frm.Show();
        }

        private void btnChangeIcon_Click(object sender, EventArgs e)
        {
            Icon = Properties.Resources.Icon1;
        }

        private void btnResetIcon_Click(object sender, EventArgs e)
        {
            Icon.Dispose();
        }

        private void ChangeLanguage(string lang)
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources =
                    new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo(lang));
            }
        }

        private void btnChangeLanguage_Click(object sender, EventArgs e)
        {
            if (btnChangeLanguage.Text == "Change Language")
            {
                ChangeLanguage("nl");
            }
            else
            {
                ChangeLanguage("en");
            }
            
            
        }

        private void btnCallClass1_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            lblCallClass1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];

        }

        private void button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Test");
        }
    }
}
